import axios from "axios";
import { pa } from "element-plus/es/locale";
import qs from "qs";

interface Response{
    code:number
    msg:string
    data?:any
}
const instance = axios.create()

const Myaxios={
    get(url:string,params?:object):Promise<Response>{
        return instance({
            url,
            method:'get',
            params
        })
    },

    post(url:string,params?:object):Promise<Response>{
        return instance({
            url,
            method:'post',
            data:qs.stringify(params)
        })
    }
}

export default Myaxios